<template>
	<view class="news-detail">
		<view class="title">{{data.title}}</view>
		<view class="info">
			<!-- <text>发表时间:{{data.public_time | formatDate}}</text> -->
			<text>发表时间:{{data.public_time}}</text>
			<text>浏览次数:{{data.click}}</text>
		</view>
		<view class="content">
			<rich-text :nodes="data.content"></rich-text>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				id:0,
				data:{}
			}
		},
		onLoad(options) {
			this.id = options.id;
			this.geNewDetail()
		},
		methods: {
			geNewDetail(){
				this.$myRequest({
					url:"getNewsDetail.json",
				}).then(res=>{
					this.data = res.data.message[0]
				})
			}
			
		}
	}
</script>

<style lang="scss">
	.news-detail{
		font-size: 30rpx;
		padding:0 20rpx;
		.title{
			text-align: center;
			margin: 20rpx;
		}
		.info{
			display: flex;
			justify-content: space-between;
		}
	}
</style>
